/**
 * User: muxin4ever
 * Date: Oct, 31, 2012
 * Time: 21:25
 */

package gui;

import java.awt.Color;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;

import common.*;

public class PanelOrganizerBar extends MyPanelLeft {
	private FrameMain f = null;
	private MyButton buttonTab = new MyButton();
	private MyLabel label = new MyLabel(new ImageIcon(
			"./image/panelOrganizer.png"));
	MyButton buttonDisplayMatrix = new MyButton(new ImageIcon(
			"./image/buttonDisplayMatrix.png"));
	MyButton buttonAddSubroutine = new MyButton(new ImageIcon(
			"./image/importSubroutine.png"));
	MyButton buttonAddByFile = new MyButton(new ImageIcon(
			"./image/buttonAddByFile.png"));
	MyButton buttonOk1 = new MyButton(new ImageIcon("./image/ok.png"));
	MyButton buttonOk2 = new MyButton(new ImageIcon("./image/ok.png"));
	MyButton buttonOk3 = new MyButton(new ImageIcon("./image/ok.png"));

	public PanelOrganizerBar(FrameMain frameMain) {
		f = frameMain;

		label.setBounds(0, 0, 300, 600);

		buttonTab.setBounds(25, 70, 130, 35);

		buttonDisplayMatrix.setBounds(45, 130, 218, 43);
		buttonAddSubroutine.setBounds(45, 190, 218, 43);
		buttonAddByFile.setBounds(45, 250, 218, 43);
		// buttonOk1.setBounds(45, 310, 218, 43);
		// buttonOk2.setBounds(45, 370, 218, 43);
		// buttonOk3.setBounds(45, 430, 218, 43);
		label.add(buttonTab);
		label.add(buttonDisplayMatrix);
		label.add(buttonAddSubroutine);
		label.add(buttonAddByFile);
		// label.add(buttonOk1);
		// label.add(buttonOk2);
		// label.add(buttonOk3);
		this.add(label);

		MouseListener listenerTab = new MouseListener() {
			public void mouseEntered(MouseEvent e) {
			}

			public void mouseClicked(MouseEvent arg0) {
				setVisible(false);
				f.getPanelCalculationBar().setVisible(true);
				//f.getPanelDisplayMatrixList().setVisible(false);
			}

			public void mouseExited(MouseEvent arg0) {
			}

			public void mousePressed(MouseEvent arg0) {
			}

			public void mouseReleased(MouseEvent arg0) {
			}
		};
		buttonTab.addMouseListener(listenerTab);

		MouseListener listenerDisplayMatrix = new MouseListener() {
			public void mouseEntered(MouseEvent e) {
			}

			public void mouseClicked(MouseEvent arg0) {
				f.getPanelDisplayMatrixList().setVisible(true);
			}

			public void mouseExited(MouseEvent arg0) {
			}

			public void mousePressed(MouseEvent arg0) {
			}

			public void mouseReleased(MouseEvent arg0) {
			}
		};
		buttonDisplayMatrix.addMouseListener(listenerDisplayMatrix);

		MouseListener listenerAddByHand = new MouseListener() {
			public void mouseEntered(MouseEvent e) {
			}

			public void mouseClicked(MouseEvent arg0) {
				f.getDialogAddSubroutine().setVisible(true);
			}

			public void mouseExited(MouseEvent arg0) {
			}

			public void mousePressed(MouseEvent arg0) {
			}

			public void mouseReleased(MouseEvent arg0) {
			}
		};
		buttonAddSubroutine.addMouseListener(listenerAddByHand);

		MouseListener listenerAddByFile = new MouseListener() {
			public void mouseEntered(MouseEvent e) {
			}

			public void mouseClicked(MouseEvent arg0) {
				f.getDialogAddByFile().setVisible(true);
			}

			public void mouseExited(MouseEvent arg0) {
			}

			public void mousePressed(MouseEvent arg0) {
			}

			public void mouseReleased(MouseEvent arg0) {
			}
		};
		buttonAddByFile.addMouseListener(listenerAddByFile);

		MouseListener listenerOk1 = new MouseListener() {
			public void mouseEntered(MouseEvent e) {
			}

			public void mouseClicked(MouseEvent arg0) {
				f.getDialogDeleteFile().setVisible(true);
			}

			public void mouseExited(MouseEvent arg0) {
			}

			public void mousePressed(MouseEvent arg0) {
			}

			public void mouseReleased(MouseEvent arg0) {
			}
		};
		/*
		 * buttonOk1.addMouseListener(listenerOk1);
		 * 
		 * MouseListener listenerOk2 = new MouseListener() { public void
		 * mouseEntered(MouseEvent e) { }
		 * 
		 * public void mouseClicked(MouseEvent arg0) {
		 * f.getDialogRenameFile().setVisible(true); }
		 * 
		 * public void mouseExited(MouseEvent arg0) { }
		 * 
		 * public void mousePressed(MouseEvent arg0) { }
		 * 
		 * public void mouseReleased(MouseEvent arg0) { } };
		 * buttonOk2.addMouseListener(listenerOk2);
		 * 
		 * MouseListener listenerOk3 = new MouseListener() { public void
		 * mouseEntered(MouseEvent e) { }
		 * 
		 * public void mouseClicked(MouseEvent arg0) {
		 * //f.getDialogConfirmDone().setVisible(true);
		 * f.getDialogConfirmError().setVisible(true); }
		 * 
		 * public void mouseExited(MouseEvent arg0) { }
		 * 
		 * public void mousePressed(MouseEvent arg0) { }
		 * 
		 * public void mouseReleased(MouseEvent arg0) { } };
		 * buttonOk3.addMouseListener(listenerOk3); }
		 */

	}
}
